package com.kantboot.business.talent.domain.vo;

import com.kantboot.business.talent.domain.entity.BusTalentTitleLevelCondition;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Entity
@Getter
@Setter
@Table(name = "bus_talent_title_level")
@Accessors(chain = true)
@EntityListeners(AuditingEntityListener.class)
@DynamicUpdate
@DynamicInsert
public class BusTalentTitleLevelHasCondition implements Serializable {


    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    /**
     * 创建时间
     */
    @CreatedDate
    @Column(name = "gmt_create")
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @CreatedDate
    @Column(name = "gmt_modified")
    private Date gmtModified;

    /**
     * 对应系列id
     */
    @Column(name = "series_id")
    private String seriesId;

    /**
     * 职称等级名称
     */
    @Column(name = "t_name")
    private String name;

    /**
     * 技能等级全称
     */
    @Column(name = "t_full_name")
    private String fullName;

    /**
     * 等级数值
     * 数值越高，等级越高
     */
    @Column(name = "t_number")
    private Long number;

    /**
     * 图标
     */
    @Column(name = "file_id_of_icon")
    private Long fileIdOfIcon;

    /**
     * 描述
     */
    @Column(name = "description",length = 5000)
    private String description;

    @OneToMany
    @JoinColumn(name = "title_level_id",referencedColumnName = "id",
            foreignKey = @ForeignKey(name = "none",value = ConstraintMode.NO_CONSTRAINT)
            ,insertable = false,updatable = false)
    private List<BusTalentTitleLevelCondition> conditions;


}
